refactoring load, set, and decode methods