Refactor main application, put constants in a separate file, and create a new
file with utility functions.