refactored shape binding