fix code style issues, skip iteration on non-key