Refactored routing and hasing mechanism. Added BaseModel.