refactor and improve

- add some further sample code in index
- add isset() handling to environment config
- minor refactor and cleanup