refactor into classes
extract html into templates/