Extracted ro/rw stuff into functions and saved cr0 value