Simplify code and fix NumberFormatException