ef implementation and upstream merge