Reorganized, refactored alveolus code