space changes
minor refactoring: use inline ifs, etc