Should be refactored into a method.