Some refactoring and method renaming