Refactoring the whole system and making it work :)