small cleanup and optimization