refactoring, code conventions fixes