Change to more object oriented style