refactored place details function