#87 backend refactoring