bugfixes, code readability & aesthetic improvements