change paths and optimize code to support more devices in the future