factor out aligned store/load code