One time pad refactor