Many fixes and refactoring