refactor #594