Finally implemented async processing.
Removed weird algorithm with copying templates to the local memory.