button view stream now redirecting to the correct page. refactoring a bit the main js file