Refactor the nertz pacakge to be modular