Work in progress for v5

Started the changes to adapt to v5