Reflects complete refactoring and includes some improvements