Moved Memory stuff into its own class.