refactoring, changed method names and signatures.