[#189] Code improvement based on @jonase feedback