faster connection
added validation and attributes handling