Major Refactoring

- rewrote some parts
- code cleanup
- added a few more options