refactor attempt