making a few tweaks to make it generic