add tests for interest rate and memory storage, refactoring