tiny code re-structure