little more refactor