renamed device function drive_device()
cleaned templates

parameterized functions