Refactorings

Moved logic to extension methods in order to build a cleaner language
inside the code base.