refactored, implemented rs256 alongside hs256.