some constant naming update + beginning of error handling