Improved front-end code