theme writting improvements and fixes