cleaned up code in home panel