re-orginze some code 1