Refactor long method
Refactor long method