re-organizing code to be able to convert it into a package