Consolidate secret helper into serialization