improved coverage, refactored, bugfixing