Relevant model has been placed in the same file.
Some function names have been modified.