Refactor and simplify.