seperated gui code