code clean up and ready for Faraday testing