custommiddleware refactorings, project app