more refactoring and increasing readibility
more refactoring and increasing readibility