Refactoring, added toInt