Refactor AJS