remove unnecessary encode() call; fix indenting