Refactor prerequisite selection