Restructure application source code