Removed duplicate code
Re-arrange common config