move timeline function out of main app file