Better task detection in code