Refactoring of God method to smaller methods