fix indentation, shorten a little some code