move code to file