[#179] some code refactoring and cleaning