Moved testing code out of source