proper module API + unit tests