Revert "Refactored writing feature"

This reverts commit 60ba81143ff899a345f420075943d93e1443afbf.
Re-Refactored for optimization: reduced function stacks for better performance and lower delays. The LED delay problem might have been due to this issue.
Minor comment changes
Resolving conflicts