condense some code...