Improved application factory a bit