refactor -> divide a method from a large scope