Made it much more generic now