bit more of refactor