refactors ram code and tests
temporarily removes the message ram for clearer debugging