Your question is not easy to understand but I think that you are asking how to reduce the size of the program. It is difficult to give advice because you have not provided all of your code, some of which is presumably in separate header or .ino files in the IDE.