small modifications and cleanup