Remove some duplication
Improve indentation