Primitive renderComponent done
Small refactoring plus tests
Added ref and updates.