load mode and theme only when needed