Implemented type-safe variable retrieval