Various cleanups & improvements