Code refactoring, depreciated .all., added return values