Some refactoring/cosmetics