Refactor and add accessor