General development.

- Refactoring code (separate run_phridge)
- General development for event handling. What's the best point to retrieve values?