moved functions to rex_view