some decoupling
rectangle factory fixed