Moved tests out of production code