switched to coffee script and refactored theme setting code