Some more refactoring, mainly on views and xml