Refactoring code style about closure, accessor