coding style and some tweaks of scripts