XD-1375 Wrapping login and logout logic as modules