Clean-up and reorganize a bit