Refactoring, some Lint issues fixed