Add initialization and tidy up spies