adjusts: refactoring & added tests (back and frontend)