some code polishing