Doing nice resizes + added a callback for it + bugfix + a bit of refactoring