split out functions into OOP