Refactoring: divide into packeges