Combined some of the code and added theming