Some cleanup of code and dependencies