refactor css and apply some templating