Abstract: Object Oriented Programming (OOP) is a contemporary favorite method of programming. OOP provides better flexibility, source codes are more organized and systematized, and it enables a group of developers to easily work with each other. Nevertheless, a poorly designed system will not only defeat the intention of coding with OOP, but also will make the software extremely difficult to maintain. Refactoring is a powerful way to improve existing code. It only changes the structure of the source code without changing its functionality. Manually refactoring larger systems not only consumes large amounts of time and money, but it also happens to be incredibly inaccurate. As a result, quick and easy refactoring with partial automation is extensively discussed in the software realm. This thesis presents algorithms for implementing nine refactorings that work on the fly for JAVA source code. The refactorings algorithms are implemented in a stepwise manner by initially selecting the source code portion for refactoring, and by choosing the correct refactoring method, and then programmatically changing the selected source code to achieve refactoring.