Removed ugly ternary operator