modes: Refactor modes listing in a stand alone file