Implemented cleaner OO code