test(app): add tests
refactor(app): code