GH-5 Deleted unused code and modified functions