step 7 - unit testing, logging, error handling