Refactored classes, namespaces. Also adapted to ABP changes.