use connection method instead of @connection
class_methods refactor