Functionality and code appearance tweaks