Refactor and bugfixing.