Replace t alias with slightly smarter function