1. change from aoh to hash
2. add gen function to generate frame format