issue#2 modularised