Refactor out long method.