cleaned up backend to have a cohesive OOP structure