some modularisation