Refactored libgma