Refactor: code moved to new helper and constants file. Also adds support for multiple types for switch/light components.