Fix resize and core refactor