small refactor fixes, ternary operators