A simple refactor to get rid of huge identation.