Changed procedural into object-oriented