js refactoring; json fixture