made a few tweaks to genericise the methods