refactor based on PR