refactor euler5