Updated Model and Database functionality