cleanup code, improve nameing.