Replaced eval with function registry