More theming fixes and clean up of code