Cleaned up db stuff