RS-2014: boolean part updated
RS-2014: removing unnecessary brackets; refactoring
RS-2014: untyped part updated