move code into subdirectory so that it can be included easier