Refactor classes into different packages