big refactor. using templates now for genning css.
splitting the code up