Refactor html pages into HAML