Update to fix bug and reorganize imports