Clean up logging
Better try/catch