Made doOnceLater a class method so it can be used more flexibly.