Minor formatting and code cleaning