refactoring code to focus only on adt