Refactoring/added AFS class