Made it a bit more generic