Fixed category structure importing and did some refactoring