statics if else change to make it cleaner