work on serial example, refactoring here and there