Some minor improvements on the code base