Updated with exceptions and loggers