Refactor and add simple example of the constructor