splitted methods in few parts for better error handling