random cleanup
added explination in comments.