refactor: minor code cleanup / fixes