refactor edition detection