Refactor a little