better init script code