refactored figure placement