Various cleanups & improvments