code cleanup and minor changes