removed duplicate code for main methods
removed duplicate code for main methods