Extract Mapping::Definition into a separate file and refactor