moved core lib into separate modules