polishing the code here and there