Changed to using JaVers API, cleaned up the code