just check for front page
some code refactoring

Signed-off-by: Norik Davtian <norik@bigemployee.com>