Refactoring. Unncessary prints are removed.