minor refactor
rafactored fuctionality