CORE-560 partialy transfered JS code to controller