major refactoring in backend