Refactor a little.