Improving DB functionality to maintain object order