refactor, fix #2