some code cleaning and beginning of themes handling