Improved data model and stored procedures