Improve logic style