completely refactored the async support