Refact long method.