[#189] Code improvements based @jonase review