Updated and modularised versions