some code to practice refactor technique, mostly collected from martin fowler's book--refactoring