Refactoring and coding standards improvements