Minor refactoring & code cleaning