Scripts changes, code refactor.