Code cleanup, use logging, rise exceptions