Consolidated some duplicate code in reposition and resize functions into a new function: modify.