wrapped router before and after filter script in a 'define' and moved where it is required to the router script