Refactor to config package