Refactor modes into their own directory