refactor single script to component module scripts, decouple modules