Revisited DB constraints & cleanup