refactored rootfs scripts