simplify constructor function, use component/querystring