refactor and add