close #5, #12; improvements, bugfixes & refactorization