major refactor and replacement of styling code