Backend

Refactoring to separate concerns.