move json answers into a method