Moved delay code to module method