Refactor a little piece of code.