Changed database component to return plain objects