1) refactored 2) made it more Object-oriented