refactored templates into haml