Implement ActiveRecord pattern, remove $database