Making some refactoring based on @elizeu comments. Second try to close issue #5