formatting, and making it more generic