code review
a bit of refacotring work