Remove React dep and refactor