move modal controller out of global namespace