polishes the sources and handles resizes