Beginning to make things a bit more DRY, better logging