cleanup and improvement