simplify code, improve error handling