move io code
move io lock code
move io lock logic
refactor