Refactor: extract Reference object
Refactor: simplify Reference code