move try function to own file