Code cleanup and sort/prune by area