refactor a little more