requires refactor