modularize the front end