Refactor. Less code-duplication.