Fix the UI on small devices

Fixes #24
Code refactoring