Refactor. Changed interfaces as previously mentioned