simplify and enhance scripts