added functionality for setting theme and disabling cache
code is more DRY
code is DRY