Second part of major refactoring after major fail