changed some ids, refactored some stuff, added validator for refId about white spaces