Feature/integration

Refactored code, should be cleaner now.