More refactoring and started with issue #67