Various improvements and cleanup

Signed-off-by: Aleksi Sapon <QcTechs@gmail.com>