cached repeatedly used objects, separated out code in functions