refactor packages

refactor packages to use objects client and serverside