Trying an oop solution