Distributed infrastructures are becoming more and more diverse in nature. An application may often need to be redeployed in various scenarios. Ideally, given an application designed for one deployment scenario, one should be able to generate an application version for a new scenario through an automated refactoring process. For this to happen, one of the principal requirements is that application components should be amenable to partitioning. To achieve this: (i) We use a structurally simple and slightly modified model of object called Breakable Object (BoB), for structuring such applications. BoB can be treated as an object which is designed to be well disposed towards automated refactoring. We also devise a programming model for BoBs in Java called JavaBoB. (ii) We provide algorithms for automated refactoring of a JavaBoBbased program.