Improve code and add 'doc' task