move to OOP and separation of duties