some code rafactoring was applied