Moved some code into Record