refactoring and add microsaccade detection code