Small refactoring of get_by_id methods

* Only single invocation of this function left in utils.general
* Removed unused _find_by_id in direct.py

Change-Id: I7d03b553212b9bc4fef74f9c8a99958827dc8a54
Merge "Small refactoring of get_by_id methods"