Code improvement

Some improvements see #3 for context.
Changed version