Move function and trigger creation into file.