Improved code for read themes