amoeba refactoring