refactored component code slightly to allow for multiple frameworks