PEP8ing and a little bit of DRY