generalized some stuff in my theme