Make more OO

Turn code to a more OO style