[minor] Refactoring and cleaning up methods