Improve code and remove useless libraries.