less code in main ,more libs