Add missing calls and refactoring

This pull request is in progress, as soon as I check everything I'll let you know that the pull request is ready.