Code improvement

Adjusted some code with regards to the feedback given on the beta
release