Shapes refactoring