bad refactor that needs fixing