refactoring, checking json output
refactored checks into individual functions
added test-mole tests