extract method + cleanup