using records to shorten code a bit