Separate main functionality into 3 composed steps: input, process, output
Refactor to improve readability
Update platform