Refactor long method