Make serial works, refactor to share code
Make serial works, refactor to share code