Working on custom enclosure and various refactorings