add a common module, make some cleanup