improve code and doku