add some styling and refactor code