refactor
almost