Refactor getPresence() method into a set of smaller methods

Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>