extensive pieces refactoring