refactor shape