little bit of refactor