Refactor elements resizing.