(#33) improve code