prototype fixes
cleanup code