refactor lib/smarthome to lib/core