app: Separate complex method
app: Use lambda to make code clear