Refactor stuff into their separate packages