Rewrite SER counting algorith to template

Details
- Error Counter is now written in a template-based way