Re-wrote core Theme class