Output functionalities and a deep refactoring