refactor out for better modularity, some css hacking