refactor: style changes to use ternary operator