Move code to proper subpackages