Declarations reordering and code cleanup.