code refactor - part II