small refactor fixes, ternary operators
Merge pull request #4 from anniesing/quick-fix

small refactor fixes, ternary operators