Add FrameRecognizer

- refactor code
- cleanup main file