use bool type where appropriate
cleanup code