Fix style and optimize dep analysis