fix, enhance and refactor