Enhanced front end and refactored code