first part of code clean up for expanded desktop