Removed mallocs that prevent async optimization