The relevant models have been placed in the same file.
Some function names have been modified.