Some refactoring for style