Moved memory into its own module