Refactoring.

* should have moved with the rest of the model classes
Adding more indexes to the db.