minor improvements, some cleanup