refactor and additions