Add minor refactoring and make methods private