Clean up core file, move dependencies to proper ns