Handling resize here was really necessary? Is it really safe to remove the code from here?