Minor optimization + code formating