Extracting style;misc refactoring