refactor getter and setter