Improved layout for small screens, optimized code