refactoring + watching memory access logic updated