refactor to namespace pattern