Removed duplicate dependency
Added utility method
Code clean, NPE check