Remove old scripts, code improvement