Refactored Timeout helper into util.Function
Syntax fix