clean up and catch mistakes