Resize is working :) 
Some code cleanup.