Button Press code simplified