further improvement/simplification of callback and timeout handling