Complete refactor to allow manual resizing