refactor some classes
reformat code (force braces)
core: use ternary operator