moved pref/loc functions to data and added a separate test file