Code refactor for method reusing.