re-structure code into different packages