Refactored and restructured barclamp