refactor to simplify constructor