Signal implemented and big refactoring