Changing functional to OO