Cache implementation from book Erlang and OTP in Action