Add checks for device - because now functions can be applied to anything
remove un-needed functions