Moved InLocation cast to separate file