clean code, fix some regression